﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
using RayDen.Library.Core.Components;

namespace RayDen.Optix.Engine.Managers
{
    public class ConfigManager : Singleton<ConfigManager>
    {

        public string Get(string name, string @defaultValue = null)
        {
            return ConfigurationManager.AppSettings[name] ?? @defaultValue;
        }


        public TValue Get<TValue>(string name, Func<string, TValue> convFunc)
        {
            var value = ConfigurationManager.AppSettings[name];
            if (string.IsNullOrWhiteSpace(value))
                return default(TValue);
            return convFunc(value);
        }


        public string[] GetSettings(string p)
        {
            return new[]
            {
@"F:\Dev\Data\Models\Sponza\textures\",
@"F:\3d\Textures\",
@"F:\3D\Models\3DSMAX\",
@"F:\3ds Max Design 2010\Maps\ProMaterials\",
@"F:\3ds Max Design 2010\sceneassets\images\",
@"F:\3ds Max Design 2010\Maps\Ground\",
@"F:\3ds Max Design 2010\Maps\Stones\",
@"F:\3ds Max Design 2010\Maps\Brick\",
@"F:\3ds Max Design 2010\Maps\Organics\",
@"F:\3ds Max Design 2010\Maps\Wood\",
@"F:\3ds Max Design 2010\Maps\Concrete\",
@"F:\3ds Max Design 2010\Maps\",
@"F:\3ds Max Design 2010\Maps\Reflection\",
@"F:\3ds Max Design 2010\Maps\Metal\",
@"F:\3ds Max Design 2010\Maps\Wood\",
@"C:\Dev\Resources\",
@"F:\Dev\Scenes\Mariinsky\",
@"F:\Dev\Scenes\Mariinsky\textures\",
@"F:\3D\Models\3DSMAX\EXPORT\sceneassets\images\",
@"G:\3dsmax\maps\ProMaterials\",
            };
        }
    }
}
